﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management/manage.master" AutoEventWireup="true" CodeFile="List.aspx.cs" Inherits="Management_News_List" Theme="DataWebControls" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script>
        if (typeof Seduce == "undefined" || !Seduce) {
            var Seduce = {};
        }

        Seduce.Alert = {
            show: function (id, txt) {
                var content = $('<div>' + txt + '</div>');
                content.insertAfter($("#" + id));
                setTimeout(function () { content.remove(); }, 1000);
            }
        };
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" AsyncPostBackTimeout="36000">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <h2 class="clearfix">
                <span class="float_l">新闻列表</span>
            </h2>
            <asp:Panel ID="Panel1" runat="server" CssClass="block">
                <a href="Add.aspx" class="btn" style="position:absolute;right:20px;">写新闻</a>
                <%--<asp:LinkButton ID="lbtnADD" runat="server" CssClass="btn" 
                    onclick="lbtnADD_Click">写新闻</asp:LinkButton>--%>
                <span>标题:</span>
                <asp:TextBox ID="txtSearchName" runat="server" CssClass="text"></asp:TextBox>
                <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="btn" onclick="lbtnSearch_Click">查询</asp:LinkButton>
                <asp:LinkButton ID="lbtnBack" runat="server" CssClass="btn" onclick="lbtnBack_Click">返回</asp:LinkButton>
            </asp:Panel>
            <div class="margin10_tb">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    onrowcommand="GridView1_RowCommand" onrowdatabound="GridView1_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="ID">
                            <ItemTemplate>
                                <asp:Label ID="lblID" runat="server" Text='<%#Eval("ID").ToString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="标题">
                            <ItemTemplate>
                                <asp:Label ID="lblTitle" runat="server" Text='<%#Eval("Title").ToString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="图片">
                            <ItemTemplate>
                                <asp:Image ID="imgLogo" runat="server" ImageUrl='<%# ResolveUrl(Eval("Pic").ToString()) %>' height="100" />
                                <asp:HiddenField ID="hidLogo" runat="server" Value='<%# Eval("Pic").ToString() %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="分类">
                            <ItemTemplate>
                                <asp:Label ID="lblTypeName" runat="server" Text='<%#Eval("TypeName").ToString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="置顶">
                            <HeaderTemplate>
                                <asp:LinkButton ID="lbtnSortSeq" CommandName="SORT" CommandArgument="Seq" runat="server">置顶</asp:LinkButton>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:DropDownList ID="ddlSeq" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSeq_SelectedIndexChanged">
                                    <asp:ListItem Text="默认" Value="1" Selected="True"></asp:ListItem>
                                    <asp:ListItem Text="置顶" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="置底" Value="0"></asp:ListItem>
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="焦点图">
                            <ItemTemplate>
                                <asp:CheckBox ID="chkIsInGallery" AutoPostBack="true" OnCheckedChanged="chkIsInGallery_CheckedChanged" Checked='<%#Convert.ToBoolean(Eval("IsInGallery")==DBNull.Value?false:Eval("IsInGallery"))%>' runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="推荐">
                            <ItemTemplate>
                                <%--<asp:CheckBox ID="chkIsHeadline" AutoPostBack="true" OnCheckedChanged="chkIsHeadline_CheckedChanged" Checked='<%#Convert.ToBoolean(Eval("IsHeadline")==DBNull.Value?false:Eval("IsHeadline"))%>' runat="server" />--%>
                                <asp:DropDownList ID="ddlIsHeadline" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlIsHeadline_SelectedIndexChanged">
                                    <asp:ListItem Text="无" Value="0" Selected="True"></asp:ListItem>
                                    <asp:ListItem Text="图片" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="文字" Value="2"></asp:ListItem>
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="lbtnEdit" CommandName="MOD" runat="server" CssClass="btn">编辑</asp:LinkButton>
                                <asp:LinkButton ID="lbtnDelete" CommandName="DEL" runat="server" CssClass="btn" OnClientClick="javascript:return confirm('确认删除么？');">删除</asp:LinkButton>
                                <asp:CheckBox ID="chkCheck" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <div class="pager margin10_tb">
                    <asp:Repeater ID="rptPageFliper" runat="server">
                        <ItemTemplate>
                            <span class='<%#(((PageNumberItem)Container.DataItem).IsCurrentPage) ? "current": string.Empty%>' class="paging">
                                <asp:LinkButton ID="lbtnPager" runat="server" CommandName="<%# ((PageNumberItem)Container.DataItem).PageNumberCommand%>"
                                    Text="<%# ((PageNumberItem)Container.DataItem).PageNumberText%>" Enabled='<%# !(((PageNumberItem)Container.DataItem).IsCurrentPage) %>'
                                    Style='<%#(((PageNumberItem)Container.DataItem).IsCurrentPage) ? "color:#eee;": "color:#eee;"%>'
                                    Font-Underline="false"></asp:LinkButton>
                            </span>
                        </ItemTemplate>
                    </asp:Repeater>
                    <asp:TextBox ID="txtPageNum" runat="server" CssClass="page-to-go"></asp:TextBox>
                    <asp:LinkButton ID="lbtnGo" runat="server" onclick="lbtnGo_Click" CssClass="linkbtn">GO</asp:LinkButton>
                    <asp:LinkButton ID="lbtnDelete" runat="server" CssClass="btn" onclick="lbtnDelete_Click" OnClientClick="javascript:return confirm('确认删除么？');">删除选中的新闻</asp:LinkButton>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

